<template>
    <div class="top">
        <itemMusicTopvue :playlists="playlistx"/>
        <ItemMusicListvue :data="datay"></ItemMusicListvue>
    </div>
</template>
<script>
import itemMusicTopvue from '../components/item/ItemMusicTop.vue'
import {getMusicgequ} from '../request/api/music'
import ItemMusicListvue from '@/components/item/ItemMusicList.vue'
// import { useRoute } from 'vue-router'
export default {
    components:{
        itemMusicTopvue,
        ItemMusicListvue
    },
   data() {
      return {
    playlistx:{},
    datay:{}
      }
   },
   computed:{
   },
   methods:{ 
    async getMusic(){  
      let id=this.$route.query.id
    let res=await getMusicgequ(id)
    // let bf=await getMusicbf(id)
    // console.log(bf)
    this.playlistx=res.data.playlist
    this.datay=res.data
    console.log(res)
  }
   },
   mounted(){
    // sessionStorage.setItem('playlists',playlist)  
    // this.playlistx=JSON.parse(sessionStorage.getItem('playlist'))
  
//     getMusicgequ(this.$route.query.id).then((res)=>{
//          let playlist=res.data.playlist 
//     sessionStorage.setItem('playlist',JSON.stringify(playlist)) 
//    }) 
    // let res=sessionStorage.getItem('playlist')
    //      this.playlist=JSON.parse(res)  
   
//     let id=this.$route.query.id
//     getMusicgequ(id).then((res)=>{
//      console.log(res)
// })

   },
   created(){  
    this.getMusic()
    // this.playlistx=JSON.parse(sessionStorage.getItem('playlist'))   
    // let res=sessionStorage.getItem('playlist')
    //      this.playlist=JSON.parse(res)   
   }
}
</script>
<style lang="less" scoped>
// .top{
//     width: 100%;
//     height: 6rem;
//     background-color: #434144;
// }
</style>
